/*
Arm Tracker and Glove Demo by Noah Zerkin (noazark AT gmail.com) 2009
Released under GNU GPLv3.0 http://www.opensource.org/licenses/gpl-3.0.html
*/

void plex(int channel){
  switch(channel){
  case 0:
    digitalWrite(mPin0, LOW);
    digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, LOW);
    break;
  case 1:
    digitalWrite(mPin0, HIGH);
    digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, LOW);
    break;
  case 2:
    digitalWrite(mPin0, LOW);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, LOW);
    break;
  case 3:
    digitalWrite(mPin0, HIGH);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, LOW);
    break;
  case 4:
    digitalWrite(mPin0, LOW);
        digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, LOW);
    break;
  case 5:
    digitalWrite(mPin0, HIGH);
        digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, LOW);
    break;
  case 6:
    digitalWrite(mPin0, LOW);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, LOW);
    break;
  case 7:
    digitalWrite(mPin0, HIGH);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, LOW);
    break;
  case 8:
    digitalWrite(mPin0, LOW);
        digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, HIGH);
    break;
  case 9:
    digitalWrite(mPin0, HIGH);
        digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, HIGH);
    break;
  case 10:
    digitalWrite(mPin0, LOW);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, HIGH);
    break;
  case 11:
    digitalWrite(mPin0, HIGH);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, LOW);
    digitalWrite(mPin3, HIGH);
    break;
  case 12:
    digitalWrite(mPin0, LOW);
        digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, HIGH);
    break;
  case 13:
    digitalWrite(mPin0, HIGH);
        digitalWrite(mPin1, LOW);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, HIGH);
    break;
  case 14:
    digitalWrite(mPin0, LOW);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, HIGH);
    break;
  case 15:
    digitalWrite(mPin0, HIGH);
    digitalWrite(mPin1, HIGH);
    digitalWrite(mPin2, HIGH);
    digitalWrite(mPin3, HIGH);
    break;
  }
}
